/*
 * @Author: xiaosihan 
 * @Date: 2024-08-03 16:54:44 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-08-04 23:41:01
 */

import Api from "./Api";

//零件协作标签接口
class PartLableApi extends Api {

    constructor() {
        super();
    }

    //添加零件
    add(modelId: string, content: string, location: any) {
        return this._post("/customer/modelComment/add", { modelId, content, location });
    }
    //修改零件
    update(data: Partial<{ id: string, title: string, content: "" }>) {
        return this._post("/customer/modelComment/update", { data });
    }
    //删除零件
    delete(id: string) {
        return this._post(`/customer/modelComment/delete?id=${id}`);
    }
    //查询零件协作的评论列表
    get(pageNum: number, pageSize: number, modelId: string) {
        return this._post("/customer/modelComment/list", { pageNum, pageSize, data: { modelId } });
    }
    //获取单个零件的信息
    get_by_id(id: string) {
        return this._post(`/customer/modelComment/get?id=${id}`);
    }
    //添加回复评论
    addCommentDetail(modelCommentId: string, replyUserId: string, content: string) {
        return this._post("/customer/modelCommentDetail/add", { modelCommentId, replyUserId, content });
    }
    //删除自己回复的评论
    deleteCommentDetail(id: string) {
        return this._post(`/customer/modelCommentDetail/delete?id=${id}`);
    }
    //查询评论参与者
    get_joiner(pageNum: number, pageSize: number, modelId: string) {
        return this._post(`/customer/modelShare/list`, { pageNum, pageSize, data: { modelId } });
    }
    delete_jioner(id: string) {
        return this._get(`/customer/modelShare/delete?id=${id}`);
    }


}
const partLableApi = new PartLableApi();
export default partLableApi;